(defmodule MAIN (export ?ALL))
(deffunction file-message (?file ?msg)
  (open ?file hooplah "a")
  (printout hooplah "Should only contain instances of " ?msg crlf)
  (close hooplah))
(defclass A (is-a USER) (role abstract))
(defclass B (is-a A)
   (role concrete))
(deffunction generate-instances (?module ?count $?classes)
  (set-current-module ?module)
  (progn$ (?field ?classes)
    (loop-for-count ?count do (make-instance of ?field))))

(defmodule BAR (import MAIN deffunction file-message)
               (import MAIN defclass A B)
               (export defclass E))
(defclass BAR::C (is-a USER) (role abstract))
(defclass BAR::D (is-a C)
   (role concrete))
(defclass BAR::E (is-a B C))

(defmodule WOZ (import MAIN deffunction file-message)
               (import BAR defclass E)
               (export defclass F))
(defclass WOZ::G (is-a E))
(defclass WOZ::F (is-a G))

(defmodule FOO (import BAR ?ALL)
               (import WOZ ?ALL)
               (import MAIN ?ALL))
